<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>博客详情</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
<!--    <link rel="stylesheet" th:href="@{/plugins/editor.md/css/editormd.min.css}">-->
  <!-- Theme style -->
  <link rel="stylesheet" th:href="@{/css/adminlte.min.css}">
  <!-- Font Awesome -->
  <link rel="stylesheet" th:href="@{/plugins/fontawesome-free/css/all.min.css}">
<!--  <link rel="stylesheet" th:href="@{/css/my.css}">-->
  <link rel="stylesheet" th:href="@{/plugins/tocbot/css/tocbot.css}">
  <link rel="stylesheet" th:href="@{/plugins/prism/css/prism.css}">
  <link rel="stylesheet" th:href="@{/css/my.css}">
  <link href="https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css" rel="stylesheet">
</head>
<!-- url('/upload/background.gif');-->
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">
  <!-- Navbar -->
  <nav class="main-header  animated fadeInDown navbar navbar-expand navbar-white navbar-light ">
    <!-- Left navbar links -->
    <ul class="navbar-nav animated fadeIn">
      <li class="nav-item">
        <!-- PushMenu插件控制主侧栏的切换按钮。
        用法
        该插件可以作为jQuery插件或使用数据API激活。
        数据API
        添加data-widget="pushmenu"到按钮以激活插件。-->
        <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fa fa-bars"></i></a>
      </li>
      <li class="nav-item d-none d-sm-inline-block">
        <h5 class="nav-link"
            style="position: absolute; right: 10px; color: #1da7ee; font-family: 'Fredoka One';">
          I am no longer confused, dreams are the only luggage.</h5>
      </li>

    </ul>

    <!-- SEARCH FORM -->
    <form class="form-inline ml-3" th:action="@{/search}">
      <div class="input-group input-group-sm">
        <input name="blogName" class="form-control form-control-navbar" type="search" placeholder="按博客名搜索..."
               aria-label="Search">
        <div class="input-group-append">
          <button class="btn btn-navbar" type="submit">
            <i class="fa fa-search"></i>
          </button>
        </div>
      </div>
    </form>
  </nav>
  <!-- /.navbar -->

  <aside class="main-sidebar sidebar-light-primary  elevation-4 animated fadeInLeft">
    <!-- 左侧容器头-->
    <h1>
      <a th:href="@{index}" class="brand-link">
        <img th:src="@{/upload/avatar.jpg}" class="brand-image img-circle elevation-3">
        <span class="brand-text font-weight-light"><h3 style="color: black">WhyBlog</h3></span>
      </a>
    </h1>
    <!-- Sidebar -->
    <!--     被选中的颜色-->
    <div class="sidebar ">
      <!-- Sidebar Menu -->
      <nav class="mt-4">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
            data-accordion="false">
          <!-- Add icons to the links using the .nav-icon class
               with font-awesome or any other icon font library -->
          <li class="nav-header">刀斩肉身</li>
          <li class="nav-item ">
            <a th:href="@{/index}" class="nav-link active" >
              <i class="fa fa-home nav-icon"></i>
              <p>首页</p>
            </a>
          </li>
          <li class="nav-item">
            <a th:href="@{/type}" class="nav-link">
              <i class="fa fa-bookmark nav-icon"></i>
              <p>分类</p>
            </a>
          </li>
<!--          <li class="nav-item">-->
<!--            <a href="https://leetcode-cn.com/u/why-21/" target="_blank" class="nav-link">-->
<!--              <i class="fa fa-tags nav-icon"></i>-->
<!--              <p>leetCode主页</p>-->
<!--            </a>-->
<!--          </li>-->
          <li class="nav-item">
            <a href="https://gitee.com/why741/" target="_blank" class="nav-link">
              <i class="fa fa-tags nav-icon"></i>
              <p>gitee</p>
            </a>
          </li>
          <li class="nav-header">心斩灵魂</li>
          <li class="nav-item">
            <a th:href="@{/archive}" class="nav-link" >
              <i class="fa fa-archive nav-icon"></i>
              <p>归档</p>
            </a>
          </li>

          <li class="nav-header">心斩灵魂</li>
          <li class="nav-item">
            <a class="nav-link" onclick="alert('页面开发中~')">
              <i class="fa fa-archive nav-icon"></i>
              <p>我的学习路线</p>
            </a>
          </li>


        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper mt-3">
    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-9">
            <div class="card card-blue card-outline mb-5 bg-color-ea">
              <div class="card-header">
                <div>
                  <span th:text="${blogContent.name}" class="text-xl">Spring重点笔记</span>
                  <span class="badge badge-primary">原创</span>
                </div>
                <div>
                  <span th:text="${#dates.format(blogContent.create_time,'YYYY-MM-dd HH:mm:ss')}" class="text-sm mr-2"><i class="far fa-calendar-alt mr-1"></i> 2019-01-01 10:08</span>
                  <span th:text="${blogContent.views}" class="text-sm"><i class="far fa-eye mr-1"></i> 10</span>
                </div>

              </div><!-- /.card-header -->
              <div class="card-body" id="blog-content">
<!--                The blog message show in this tag but it is not to show .-->
 <textarea id="middle"  style="display: none;" th:utext="${blogContent.content}"></textarea>
<!-- Blog messages was processed by js to show in this tag.  -->
 <div id="article" style="
   background-repeat: no-repeat;
    background-size: 100% 100%;
    -webkit-background-size: 100% 100%;
    background-attachment: fixed;
    -webkit-background-attachment: fixed;"></div>

              </div>
              <!-- /.card-body -->
            </div>
            <!-- /.nav-tabs-custom -->
          </div>
          <!-- /.col -->

          <div class="col-md-3 d-none d-md-block">
            <!-- Profile Image -->
            <div class="card card-primary card-outline bg-color-ea sticky-top">
              <div class="card-header text-center text-lg">
                目录
              </div><!-- /.card-header -->
              <div class="card-body toc p-2" id="toc">
              </div>
              <!-- /.card-body -->
            </div>
            <!-- /.card -->
          </div>
          <!-- /.col -->
        </div>
        <!-- /.row -->
      </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  <footer class="main-footer">
    <p class="text-center mb-1">
       Powered by AdminLTE
    </p>
    <p class="text-center">
      <a href="http://beian.miit.gov.cn" target="_blank">辽ICP备2020013405号</a>
    </p>
  </footer>
</div>
<!-- ./wrapper -->

<!-- jQuery -->
<script th:src="@{/plugins/jquery/jquery.min.js}"></script>
<!-- Bootstrap 4 -->
<script th:src="@{/plugins/bootstrap/js/bootstrap.bundle.min.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/js/adminlte.min.js}"></script>

<script th:src="@{/plugins/tocbot/js/tocbot.min.js}"></script>
<script th:src="@{/plugins/prism/js/prism.js}"></script>
<!--<script th:src="@{/plugins/editor.md/js/editormd.min.js}"></script>-->
<script th:src="@{/js/detail.js}"></script>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/showdown/1.3.0/showdown.min.js"></script>

<script type="text/javascript">
     //  The blog mesasge was got by this code.
    var content = $("#middle").val();
    //  process the markdown data.
    var converter = new showdown.Converter(); //初始化转换器
    var htmlcontent  = converter.makeHtml(content); //将MarkDown转为html格式的内容
    $("#article").html(htmlcontent);//添加到div中显示出来

    // ************************************
    // 如果不希望在前端的开发者工具里显示出来后台的数据
    // **********************************
    // 在 js 最后把把input的值置空
    // $("#middle").attr("value", "");

</script>
</body>
</html>
